<template>
  <div class="page-header">
    <div class="header-content" :style="{
          'padding-right': `calc(100vw - ${rightIconInfo.left - 15}px)`,
          'padding-top': `${rightIconInfo.top}px`,
        }">
      <div class="main-content" :style="{ height: `${rightIconInfo.height}px` }">
        <div>
          <div class="content" :style="{ 'padding-left': `calc(100vw - ${rightIconInfo.left - 15}px)` }">
            <div class="icon-content">
              <uni-icons type="back" size="20" @click="$pageBack" />
            </div>
            <div class="title-content">
              <h2 v-text="headerTitle" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import commonMixins from '../../mixins/common';
  
  export default {
    name: 'PageHeader',
    mixins: [ commonMixins ],
    components: {},
    props: {
      headerTitle: {
        type: [ String, Number ],
        default: '',
      },
    },
    data() {
      return {};
    },
    computed: {},
    watch: {},
    mounted() {
    },
    created() {
    },
    methods: {},
  };
</script>

<style lang="scss" scoped>
  .page-header {
    border-bottom: 1px solid #eeeeee;
    .header-content {
      background-color: white;
      padding: 15px;
      padding-left: 0;
      .main-content {
        position: relative;
        > div {
          position: absolute;
          top: 50%;
          transform: translateY(-50%);
          width: 100%;
          .content {
            position: relative;
            .icon-content {
              position: absolute;
              left: 15px;
              top: 50%;
              transform: translateY(-50%);
            }
            .title-content {
              flex: 1;
              padding: 0 10px;
              h2 {
                text-align: center;
                color: #021930;
                font-size: 16px;
                font-weight: 600;
              }
            }
          }
        }
      }
    }
  }
</style>
